import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree tree = new BinaryTree();
        BinaryTree.treeNode node1 = new BinaryTree.treeNode('A');
        BinaryTree.treeNode node2 = new BinaryTree.treeNode('B');
        BinaryTree.treeNode node3 = new BinaryTree.treeNode('C');
        BinaryTree.treeNode node4 = new BinaryTree.treeNode('D');
        BinaryTree.treeNode node5 = new BinaryTree.treeNode('E');
        node1.left = node2;
        node1.right = node3;
        node2.left = node4;
        node4.right = node5;
//        打印前序遍历后的结果
        tree.preOrder(node1);
        System.out.println();
        System.out.println("===================");
//        打印中序遍历的结果
        tree.inOrder(node1);
        System.out.println();
        System.out.println("===================");
//        打印后序遍历的结果
        tree.postOrder(node1);
        System.out.println();
        //打印出树的结点个数
        System.out.println(tree.size(node1));
        //获取叶子结点的个数
        System.out.println(tree.getLeafNodeCount(node1));
        //测试第k层节点个数
        System.out.println("====================");
        System.out.println(tree.getKLevelNodeCount(node1,1));
        System.out.println(tree.getKLevelNodeCount(node1,2));
        System.out.println(tree.getKLevelNodeCount(node1,3));
        System.out.println(tree.getKLevelNodeCount(node1,4));
        System.out.println("====================");
        System.out.println(tree.getHeight(node1));
        System.out.println("=======================");
        System.out.println(tree.find(node1,'A'));
        System.out.println(tree.find(node1,'E'));
        System.out.println(tree.find(node1,'M'));
        System.out.println("==========================");
        tree.levelOrder(node1);
        System.out.println("===============");
        System.out.println(tree.isCompleteTree(node1));
    }
}
